package com.camps.sdk.decrypt;

import com.camps.sdk.common.Constants;
import com.camps.sdk.entity.CleanSim;
import com.camps.sdk.entity.DeviceUpMessage;

/**
 * @Author ldaoliang
 * @Date create in 15:58 2021/9/1
 * @Description
 */
public class AnalyzeClearSim implements AnalyticalData {
    @Override
    public DeviceUpMessage parseData(String originalData) {
        //*WT,866248053277370,CLEANSIM,183921,13912345678,170721,FDFFFFFF
        //解密
        String[] split = parseCommand(originalData);
        String imei = split[1];
        String commandNumber = split[3];
        String simCard = split[4];
        String date = split[5];//日月年
        String deviceStatus = split[6];
        CleanSim cleanSim = new CleanSim();
        cleanSim.setDeviceStatus(deviceStatus);
        cleanSim.setDeviceDate(date);
        cleanSim.setSimCard(simCard);
        cleanSim.setImei(imei);
        cleanSim.setDeviceTime(commandNumber);
        cleanSim.setCommandNumber(commandNumber);
        return structureMessage(Constants.REPLY,Constants.CMD_CLEAR_SIM,false,"",cleanSim);
    }
}
